package com.lzx.iteam;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import com.lzx.iteam.R;

public class CancelBatchSendSmsActivity extends Activity{

    public static final int CANCEL_DIALOG_ID = 1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        showDialog(CANCEL_DIALOG_ID);
    }
    
    @Override
    protected Dialog onCreateDialog(int id) {
        switch(id){
            case CANCEL_DIALOG_ID:
                AlertDialog dialog = new AlertDialog.Builder(this).setMessage("取消群发？").setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
                    
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        BatchSendSmsService.running = false;
                        finish();
                    }
                }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                    
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        finish();
                    }
                }).create();
                return dialog;
        }
        return super.onCreateDialog(id);
    }
}
